<script setup lang="ts">
import { ref,computed } from 'vue'
import { useStore } from "../store";
const store = useStore();

const count = ref(0)
const showcount = computed(()=>{
  return store.getters.getCount
})
const addBtn = ()=>{
  store.commit('setCount',++count.value)
}
</script>

<template>
  <h1>{{ showcount }}</h1>
  <button type="button" @click="addBtn">count is: {{ count }}</button>
</template>

<style scoped>
a {
  color: #42b983;
}

label {
  margin: 0 0.5em;
  font-weight: bold;
}

code {
  background-color: #eee;
  padding: 2px 4px;
  border-radius: 4px;
  color: #304455;
}
</style>
